package teach.day04;

//队列--
import java.util.LinkedList;
import java.util.Queue;

public class P07QueueDemo {
    public static void main(String[] args) {
        Queue<Integer> q = new LinkedList<Integer>();
        for (int i = 0; i < 10; i++) {
            q.offer(i); //入队
        }
        while (!q.isEmpty()) {
            System.out.print(q.peek()); //输出队首
            q.poll();   //出队
        }
    }
}
